- user = spam_log.user
%tr
  %td
    = time_ago_with_tooltip(spam_log.created_at)
  %td
    - if user
      = link_to user.name, [:admin, user]
      .light.small
        加入时间 #{time_ago_with_tooltip(user.created_at)}
    - else
      (已删除)
  %td
    = spam_log.source_ip
  %td
    = spam_log.via_api? ? 'Y' : 'N'
  %td
    = spam_log.noteable_type
  %td
    = spam_log.title
  %td
    = truncate(spam_log.description, length: 100)
  %td
    - if user
      = link_to '删除用户', admin_spam_log_path(spam_log, remove_user: true),
        data: { confirm: "确定要删除用户 #{user.name} 么？" }, method: :delete, class: "btn btn-xs btn-remove"
  %td
    - if user && !user.blocked?
      = link_to '禁用用户', block_admin_user_path(user), data: {confirm: '确定要禁用用户么？'}, method: :put, class: "btn btn-xs"
    - else
      .btn.btn-xs.disabled
        已被禁用
    = link_to '删除日志', [:admin, spam_log], remote: true, method: :delete, class: "btn btn-xs btn-close js-remove-tr"
